﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.NetworkInformation;
using System.Text;
using System.Windows;

namespace DBSync
{
    class InternetDetector
    {

        public static Boolean connState = false;
        public static Boolean detectInternetConnection(string host)
        {
            try
            {
                Ping ping = new Ping();
                ping.Send(host);
                connState = true;
            }
            catch(Exception ex)
            {
                //MessageBox.Show("Sorry,Internet is not connected", "Internet N/A", MessageBoxButtons.OK);
                //return false;
                connState = false; 
            }
            return connState;

        }

        public static Boolean getConnectionStatus()
        {
            return connState;
        }

        
    }
}
